package com.neusoft.elmboot.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.neusoft.elmboot.po.User;
import com.neusoft.elmboot.po.UserCart;

import com.neusoft.elmboot.service.UserCartService;

@RestController
@RequestMapping("/UserCartController")
public class UserCartController {
	@Autowired
	private UserCartService usercartService;
	
	@RequestMapping("/listUserCart")
	 public List<UserCart> listUserCart(UserCart usercart) throws Exception{
		 return usercartService.listUserCart();
	 }
	
	@RequestMapping("/getUserCartByIdByPass")
	 public UserCart getUserCartByIdByPass(UserCart usercart) throws Exception{
	 return usercartService.getUserCartByIdByPass(usercart);
	 }
	
	@RequestMapping("/addUserById")
	 public int addUserById(UserCart usercart) throws Exception{
	 return usercartService.addUserById(usercart);
	 }
	
	@RequestMapping("/getUserCartByUserId")
	 public UserCart getUserCartByUserId(UserCart usercart) throws Exception{
	 return usercartService.getUserCartByUserId(usercart);
	 }
	
	@RequestMapping("/subBalanceById")
	 public int subBalanceById(UserCart usercart) throws Exception{
	 return usercartService.subBalanceById(usercart);
	 }
	
	@RequestMapping("/updateAmountById")
	 public int updateAmountById(UserCart usercart) throws Exception{
	 return usercartService.updateAmountById(usercart);
	 }

}
